<?php
/*
 * @Description: demo
 * @Version: 1.0
 * @Autor: wuyangii@qq.com
 * @Date: 2022-07-18 15:05:26
 * @LastEditors: wuyangii@qq.com
 * @LastEditTime: 2022-08-10 13:56:41
 */

namespace app\common\model;

use think\Model;

class Base extends Model
{
 
    protected $tdb = "fq_";

    static function successResult($data = [], $msg = "操作成功", $state = 1, $code = 200)
    {
        return json([
            "state" => $state,
            "msg" => $msg,
            "code" => $code,
            "data" => $data
        ]);
    }

    static function errorResult($msg = "操作失败", $state = 0, $code = 422)
    {
        return json([
            "state" => $state,
            "msg" => $msg,
            "code" => $code,
            "data" => []
        ]);
    }

}
